//
//  YHDetailLeftCell.m
//  LyhToolsTest
//
//  Created by LYH on 2018/10/27.
//  Copyright © 2018年 LYH.com. All rights reserved.
//

#import "YHDetailLeftCell.h"

@implementation YHDetailLeftCell

/**
 *  cell的初始化方法，一个cell只会调用一次
 *  一般在这里添加所有可能显示的子控件，以及子控件的一次性设置
 */
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加UI控件
        [self LoadUI];
        [self setconstraint];
    }
    return self;
}
- (void)LoadUI
{
    [self TitleLab];
    [self Detaillab];
}
//设置约束
- (void)setconstraint
{
    [self.TitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.centerY.equalTo(self.contentView);
    }];
    [self.Detaillab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.TitleLab.mas_right).offset(5);
        make.centerY.equalTo(self.TitleLab);
    }];
}
- (UILabel *)TitleLab
{
    if (!_TitleLab) {
        _TitleLab = [[UILabel alloc]init];
        _TitleLab.font = [UIFont systemFontOfSize:14];
        _TitleLab.textColor = [UIColor darkTextColor];
        _TitleLab.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:_TitleLab];
    }
    return _TitleLab;
}
- (UILabel *)Detaillab
{
    if (!_Detaillab) {
        _Detaillab = [[UILabel alloc]init];
        _Detaillab.font = [UIFont systemFontOfSize:13];
        _Detaillab.textColor = [UIColor lightGrayColor];
        _Detaillab.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:_Detaillab];
    }
    return _Detaillab;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
@end
